<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org"
      layout:decorator="layout/m_master">
<div layout:fragment="content">
    <link href="/m/css/center/pay.css" rel="stylesheet"/>
    <div class="page-group">
        <div class="page page_pay">
            <div th:replace="layout/m_layout::title('订单支付')"></div>
            <div class="page-content">
                <div class="head">
                    <div><img th:src="${qrcode}" width="256" height="256"></div>
                    <h3 class="money">¥ [[${data.payAmount}]]</h3>
                    <p class="title" th:text="${data.itemName}">
                    </p>
                </div>
                <div class="">
                    <div style="padding: .5rem .5rem; margin-top:2rem;">
                        <button class="btn btn-success btn-block submit">
                            支付完成
                        </button>
                    </div>
                    <div style="padding: .5rem .5rem;">
                        <button class="btn btn-invalid btn-block" onclick="window.history.go(-1)" type="submit">
                            取消支付
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
<!--    <script src="/static/m/js/jquery.qrcode.min.js" type="text/javascript"></script>-->
    <script>
        $(".btn-success").click(function () {
            var orderNo = $("#orderNo").val();
            $.get("/pay/hpj/weixin/"+orderNo,{},function(d){
                var data = d.data;
                if (data==0){
                    alert("未找到支付订单");
                }
                else if (data==1){
                    alert("订单支付成功");
                    window.location = $("#successUrl").val();
                }else if (data==2){
                    alert("该订单待支付");
                }
            });
        });
    </script>
    <div th:replace="layout/m_layout::systemJs"></div>
</div>
</html>

